package com.flying.invest.discovery.service;

import java.util.Date;

import com.flying.common.annotation.DaoCreate;
import com.flying.common.annotation.DaoQuery;
import com.flying.common.annotation.DaoRemove;
import com.flying.common.annotation.DaoUpdate;
import com.flying.common.util.Codes;
import com.flying.framework.annotation.MethodInfo;
import com.flying.framework.annotation.Param;
import com.flying.framework.annotation.Service;
import com.flying.framework.service.AbstractService;
import com.flying.framework.model.ActionResult;
import com.flying.framework.model.QueryResult;

import com.flying.invest.discovery.model.DiscoveryOpportunity;

@Service(value="DiscoveryOpportunityService", desc="投资机会")
public class DiscoveryOpportunityService extends AbstractService{
        
	@MethodInfo("新增")
	@DaoCreate(entity=DiscoveryOpportunity.ENTITY_NAME)
	public DiscoveryOpportunity create(
			@Param(value=DiscoveryOpportunity.USER_ID, required=true,	desc="所属用户") Long user_id,
			@Param(value=DiscoveryOpportunity.DISCOVERY_ID, required=true,	desc="发现定义") Long discovery_id,
			@Param(value=DiscoveryOpportunity.ASSETS_ID, required=true,	desc="投资品种ID") Long assets_id,
			@Param(value=DiscoveryOpportunity.INVEST_ID, required=false,	desc="投资项目") Long invest_id,
			@Param(value=DiscoveryOpportunity.SUGGESTION_ID, required=false,	desc="建议ID") Long suggestion_id,
			
			@Param(value=DiscoveryOpportunity.NAME, required=false,	desc="名称") String name,
			@Param(value=DiscoveryOpportunity.REMARKS, required=false,	desc="说明") String remarks,
			@Param(value=DiscoveryOpportunity.STATUS, required=false,	desc="状态（0：待处理；1：已投资；2：已建议；3：已交易；4：已取消）") Integer status,
			@Param(value=DiscoveryOpportunity.PRICE, required=true,	desc="价格") Double price,
			@Param(value=DiscoveryOpportunity.TRANSACTION_TYPE, required=true,	desc="交易类型（1：买入；-1：卖出）") Integer transaction_type,
			
			@Param(value=DiscoveryOpportunity.CREATOR, required=false,	desc="创建人") String creator,
			@Param(value=DiscoveryOpportunity.CREATE_TIME, required=false,	desc="创建时间") Date create_time
		) {
		return null;
	}

	@MethodInfo("修改")
	@DaoUpdate(entity=DiscoveryOpportunity.ENTITY_NAME)
	public ActionResult update(
		
			@Param(value=DiscoveryOpportunity.OPPORTUNITY_ID, required=true,	desc="机会ID") Long opportunity_id,
			@Param(value=DiscoveryOpportunity.USER_ID, required=true,	desc="所属用户") Long user_id,
			@Param(value=DiscoveryOpportunity.DISCOVERY_ID, required=true,	desc="发现定义") Long discovery_id,
			@Param(value=DiscoveryOpportunity.ASSETS_ID, required=true,	desc="投资品种ID") Long assets_id,
			@Param(value=DiscoveryOpportunity.INVEST_ID, required=false,	desc="投资项目") Long invest_id,
			@Param(value=DiscoveryOpportunity.SUGGESTION_ID, required=false,	desc="建议ID") Long suggestion_id,
			@Param(value=DiscoveryOpportunity.NAME, required=false,	desc="名称") String name,
			@Param(value=DiscoveryOpportunity.REMARKS, required=false,	desc="说明") String remarks,
			@Param(value=DiscoveryOpportunity.STATUS, required=false,	desc="状态（0：待处理；1：已投资；2：已建议；3：已交易；4：已取消）") Integer status,
			@Param(value=DiscoveryOpportunity.PRICE, required=true,	desc="价格") Double price,
			@Param(value=DiscoveryOpportunity.QUANTITY, required=false,	desc="交易数量") Double quantity,
			@Param(value=DiscoveryOpportunity.TRANSACTION_TYPE, required=true,	desc="交易类型（1：买入；-1：卖出）") Integer transaction_type,
			@Param(value=DiscoveryOpportunity.TRANSACTION_DATE, required=false,	desc="交易日期") Date transaction_date,
			@Param(value=DiscoveryOpportunity.TRANSACTION_ID, required=false,	desc="交易ID") Long transaction_id,
			@Param(value=DiscoveryOpportunity.CREATOR, required=false,	desc="创建人") String creator,
			@Param(value=DiscoveryOpportunity.CREATE_TIME, required=false,	desc="创建时间") Date create_time,
			@Param(value=DiscoveryOpportunity.UPDATOR, required=false,	desc="修改人") String updator,
			@Param(value=DiscoveryOpportunity.UPDATE_TIME, required=false,	desc="修改时间") Date update_time
		) {
		return null;
	}

	@MethodInfo("删除")
	@DaoRemove(entity=DiscoveryOpportunity.ENTITY_NAME)
	public ActionResult remove(
		
			@Param(value=DiscoveryOpportunity.OPPORTUNITY_ID, required=true,	desc="机会ID") Long opportunity_id
		) {
		return null;
	}

	@MethodInfo("搜索")
	@DaoQuery(entity=DiscoveryOpportunity.ENTITY_NAME, pageable=true, modelClass=DiscoveryOpportunity.class)
	public QueryResult<DiscoveryOpportunity> findAll(
			@Param(value=Codes.PAGE_NUM, 	required=false, desc="分页页号，默认0") int page,
			@Param(value=Codes.PAGE_SIZE, 	required=false, desc="分页大小，默认10") int rows) {
		return null;
	}

	@MethodInfo("查询")
	@DaoQuery(entity=DiscoveryOpportunity.ENTITY_NAME, single=true, throwsNotFoundException=true )
	public DiscoveryOpportunity findById(
		
			@Param(value=DiscoveryOpportunity.OPPORTUNITY_ID, required=true,	desc="机会ID") Long opportunity_id
		) {
		return null;
	}

}